package testcase.framework;

import junit.framework.TestCase;

import org.junit.Test;

import satir.card.AccomplishToolCard;
import satir.card.ActCard;
import satir.card.Card;
import satir.card.EventCard;
import satir.card.SayCard;
import satir.card.SkipToolCard;
import satir.command.Command;
import satir.framework.LazyInitiator;

/*
 * Test Objective: Test creation on an example of Card
 */
public class LazyInitiator_get_1 extends TestCase{
	
	//Step 1, Create a SayCard
	@Test
	public void testGetCommandStep1() {
		assertEquals(SayCard.class, LazyInitiator.get("SayCard", "SayCard1").getClass());
	}

	//Step 2, Create an ActCard
	@Test
	public void testGetCommandStep2() {
		assertEquals(ActCard.class, LazyInitiator.get("ActCard", "ActCard1").getClass());
	}

	//Step 3, Create an EventCard
	@Test
	public void testGetCommandStep3() {
		assertEquals(EventCard.class, LazyInitiator.get("EventCard", "EventCard1").getClass());
	}
	
	//Step 4, Create an AccomplishToolCard
	@Test
	public void testGetCommandStep4() {
		assertEquals(AccomplishToolCard.class, LazyInitiator.get("AccomplishToolCard", "AtCard1").getClass());
	}
	
	//Step 5, Create a SkipToolCard
	@Test
	public void testGetCommandStep5() {
		assertEquals(SkipToolCard.class, LazyInitiator.get("SkipToolCard", "SkipCard1").getClass());
	}
	
	//Step 6, Get the same instance from pool
	@Test
	public void testGetCommandStep6() {
		Card card = (Card)LazyInitiator.get("SkipToolCard", "SkipCard1");
		Card card2 = (Card)LazyInitiator.get("SkipToolCard", "SkipCard1");
		assertEquals(card, card2);
	}

}
